import React from 'react';
import DisCover from './discover'
var dd={};
var idd={};
var arr=[];
class M extends React.Component{
    constructor(props) {
        super(props);
        console.log(this.props.location.query);
        idd = this.props.location.query

        $.ajax({
            url: 'http://10.31.160.51/react/data.php',
            type: 'get',
            async:false,
            dataType: 'json',
            success:function(data){
                
                dd = data;

            }
        })
    }

    render(){
       var ddd=dd[1]
       var gequ={}
       var song = 'song?id='+idd.id;
       console.log(idd)
       console.log(song)
       for(var i=0;i<ddd.length;i++){
           if(ddd[i].url == song){
                console.log(ddd[i].name)
                gequ = ddd[i]
           }
       }
       
       $(function(){
           function getNowFormatDate() {
                var date = new Date();
                var seperator1 = "-";
                var seperator2 = ":";
                var month = date.getMonth() + 1;
                var strDate = date.getDate();
                if (month >= 1 && month <= 9) {
                    month = "0" + month;
                }
                if (strDate >= 0 && strDate <= 9) {
                    strDate = "0" + strDate;
                }
                var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
                        + " " + date.getHours() + seperator2 + date.getMinutes()
                        + seperator2 + date.getSeconds();
                return currentdate;
            }
           $('#auto-id-FWclDtBS9LTPq6Zh').on('click',function(){
               var $newP='';
               var $textarea=$('#auto-id-uvWvT457M7R8lVkV').val();
               console.log($textarea);
               $newP='<div id="4539688131498636538115" class="itm" data-id="453968813">'+
               ' <div class="head"><a href="/user/home?id=295163181"><img src="http://p1.music.126.net/D2gzrO5bxpHo_WHFk5kxIA==/19172184253730857.jpg?param=50y50"/></a></div>'+
                '<div class="cntwrap">'+
                    '<div class="">'+
                       ' <div class="cnt f-brk"><a href="/user/home?id=295163181" class="s-fc7">涉水2016</a> : '+$textarea+'</div>'+
                   ' </div>'+
                    '<div class="rp">'+
                        '<div class="time s-fc4">'+getNowFormatDate()+'</div><span class="dlt"><a href="javascript:void(0)" class="s-fc3" data-id="453968813" data-type="delete">删除</a><span class="sep"></span></span>'+
                       ' <a data-id="453968813" data-type="like" href="javascript:void(0)"><i class="zan u-icn2 u-icn2-12"></i></a><span class="sep">|</span><a href="javascript:void(0)" class="s-fc3" data-id="453968813" data-type="reply">回复</a></div>'+
                '</div>'+
            '</div>'

            $('#auto-id-dwDVO8948NpLgk6v').append($newP);

           })
       })

        return(
            <div className="g-bd4 f-cb">
                <div className="g-mn4">
                    <div className="g-mn4c">
                        <div className="g-wrap6">
                            <div className="m-lycifo">
                                <div className="f-cb">
                                    <div className="cvrwrap f-cb f-pr">
                                        <div className="u-cover u-cover-6 f-fl">
                                            <img src={gequ.img} className="j-img" data-src="http://p4.music.126.net/csywqB-1I7RriFpJqTzpBQ==/3434874326295928.jpg"/>
                                            <span className="msk f-alpha"></span>
                                        </div>
                                        <div className="out s-fc3">
                                            <i className="u-icn u-icn-95 f-fl"></i>
                                            <a data-action="outchain" data-rt="" data-href="/outchain/2/35618531/" className="des s-fc7">生成外链播放器</a>
                                        </div>
                                    </div>
                                    <div className="cnt">
                                        <div className="hd">
                                            <i className="lab u-icn u-icn-37"></i>
                                            <div className="tit">
                                                <em className="f-ff2">{gequ.name}</em>
                                            </div>
                                        </div>
                                        <p className="des s-fc4">歌手：<span title={gequ.geshou}><a className="s-fc7" href="/artist?id=4903">{gequ.geshou}</a></span></p>
                                        <p className="des s-fc4">所属专辑：<a href="/album?id=3291292" className="s-fc7">飞船，宇航员</a></p>
                                        <div className="m-info">
                                            <div id="content-operation" className="btns f-cb" data-rid="35618531" data-type="18">
                                                <a data-res-action="play" data-res-id="35618531" data-res-type="18" href="javascript:;" className="u-btn2 u-btn2-2 u-btni-addply f-fl" hidefocus="true" title="播放"><i><em className="ply"></em>播放</i></a>
                                                <a data-res-action="addto" data-res-id="482386133" data-res-type="18" href="javascript:;" className="u-btni u-btni-add" hidefocus="true" title="添加到播放列表"></a>
                                                <a data-res-id="35663368" data-res-type="19" data-count="-1" data-res-name="Pink UP" data-res-action="fav" className="u-btni u-btni-fav " href="javascript:;">
                                                    <i>收藏</i>
                                                </a>
                                                <a data-res-id="35663368" data-res-type="19" data-count="401" data-res-action="share" data-res-name="Pink UP" data-res-author="Apink" data-res-authors="Apink" data-res-pic="" className="u-btni u-btni-share " href="javascript:;"><i>(401)</i></a>
                                                <a data-res-id="35663368" data-res-type="19" data-res-action="download" className="u-btni u-btni-dl " href="javascript:;"><i>下载</i></a>
                                                <a data-res-action="comment" href="javascript:;" className="u-btni u-btni-cmmt "><i>(<span id="cnt_comment_count">368</span>)</i></a>
                                            </div>
                                        </div>
                                        <div id="lyric-content" className="bd bd-open f-brk f-ib" data-song-id="35618531" data-third-copy="false">
                                            
                                            {gequ.lrc}


                                        
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div className="n-cmt" id="comment-box" data-tid="R_SO_4_472646451" data-count="0">
                                <div id="auto-id-EBDRiJ9mTrta9upn">
                                    <div className="u-title u-title-1">
                                        <h3><span className="f-ff2">评论</span></h3>
                                        <span className="sub s-fc3">共<span className="j-flag">19381</span>条评论</span>
                                    </div>
                                    <div className="m-cmmt">
                                        <div className="iptarea">
                                            <div className="head"><img src="http://p3.music.126.net/D2gzrO5bxpHo_WHFk5kxIA==/19172184253730857.jpg?param=50y50"/></div>
                                            <div className="j-flag">
                                                <div>
                                                    <div className="m-cmmtipt f-cb f-pr">
                                                        <div className="u-txtwrap holder-parent f-pr">
                                                            <textarea className="u-txt area j-flag" placeholder="评论" id="auto-id-uvWvT457M7R8lVkV"></textarea></div>
                                                        <div className="btns f-cb f-pr auto-1498636538116-parent"><i className="icn u-icn u-icn-36 j-flag" id="auto-id-E49dbeQ4Nl81xF6B"></i><i className="icn u-icn u-icn-41 j-flag"
                                                                id="auto-id-PQzG22zETNoTatv1"></i><a href="javascript:void(0)" className="btn u-btn u-btn-1 j-flag" id="auto-id-FWclDtBS9LTPq6Zh">评论</a>
                                                            <span
                                                                className="zs s-fc4 j-flag">140</span>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div className="cmmts j-flag" id="auto-id-dwDVO8948NpLgk6v">
                                            <h3 className="u-hd4">最新评论(19381)</h3>
                                            <div id="4539688131498636538115" className="itm" data-id="453968813">
                                                <div className="head"><a href="/user/home?id=295163181"><img src="http://p1.music.126.net/D2gzrO5bxpHo_WHFk5kxIA==/19172184253730857.jpg?param=50y50"/></a></div>
                                                <div className="cntwrap">
                                                    <div className="">
                                                        <div className="cnt f-brk"><a href="/user/home?id=295163181" className="s-fc7">涉水2016</a>：11</div>
                                                    </div>
                                                    <div className="rp">
                                                        <div className="time s-fc4">刚刚</div><span className="dlt"><a href="javascript:void(0)" className="s-fc3" data-id="453968813" data-type="delete">删除</a><span className="sep"></span></span>
                                                        <a
                                                            data-id="453968813" data-type="like" href="javascript:void(0)"><i className="zan u-icn2 u-icn2-12"></i></a><span className="sep">|</span><a href="javascript:void(0)" className="s-fc3"
                                                                data-id="453968813" data-type="reply">回复</a></div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div className="g-sd4">
                    <img src="../../../images/SS]I`POXI(15]DT[CQYWI5B.png"/>
                </div>
            </div>
        )
    }
}

module.exports= M;